package com.example.common.view.adapter

import com.bumptech.glide.Glide
import com.bumptech.glide.load.engine.DiskCacheStrategy
import com.bumptech.glide.load.resource.bitmap.RoundedCorners
import com.example.db.entity.BannerEntity
import com.example.image.R
import com.example.image.glide.GlideImgLoader
import com.youth.banner.adapter.BannerImageAdapter
import com.youth.banner.holder.BannerImageHolder

class ImageBannerAdapter(list:MutableList<BannerEntity>):BannerImageAdapter<BannerEntity>(list){
    override fun onBindView(holder: BannerImageHolder, data: BannerEntity, position: Int, size: Int) {
        Glide.with(holder.imageView)
            .load(data.resId)
            .error(R.drawable.ic_yu_icon)
            .placeholder(R.drawable.ic_yu_icon)
            .skipMemoryCache(false)
            .diskCacheStrategy(DiskCacheStrategy.AUTOMATIC)
            .transform(RoundedCorners(50))
            .into(holder.imageView)
        //GlideImgLoader.loadResImage(holder.imageView,data.resId,holder.imageView)
    }
}